import request from "@/utils/request";

// 查询发票列表
export function listCsmInvoiceM(query) {
  return request({
    url: "/machine/csmInvoiceM/list",
    method: "get",
    params: query,
  });
}

// 查询发票汇总
export function listCsmInvoiceMSum(query) {
  return request({
    url: "/machine/csmInvoiceM/sumList",
    method: "get",
    params: query,
  });
}

// 查询发票详细
export function getCsmInvoiceM(id) {
  return request({
    url: "/machine/csmInvoiceM/" + id,
    method: "get",
  });
}

// 新增发票
export function addCsmInvoiceM(data) {
  return request({
    url: "/machine/csmInvoiceM",
    method: "post",
    data: data,
  });
}

// 修改发票
export function updateCsmInvoiceM(data) {
  return request({
    url: "/machine/csmInvoiceM",
    method: "put",
    data: data,
  });
}

// 删除发票
export function delCsmInvoiceM(id) {
  return request({
    url: "/machine/csmInvoiceM/" + id,
    method: "delete",
  });
}

// 查询单号
export function getInvoiceDocumentNo() {
  return request({
    url: "/machine/csmInvoiceM/getInvoiceDocumentNo",
    method: "get",
  });
}

// 审核
export function auditInvoiceM(data) {
  return request({
    url: "/machine/csmInvoiceM/audit",
    method: "put",
    data: data,
  });
}

// 查询开票单位
export function listBillUnit() {
  return request({
    url: "/machine/csmInvoiceM/listBillUnit",
    method: "get",
  });
}

// 查询发票抬头
export function listInvoiceTitle() {
  return request({
    url: "/machine/csmInvoiceM/listInvoiceTitle",
    method: "get",
  });
}

// 查询未开票金额
export function getInvoicePriceByBusiUnit(query) {
  return request({
    url: "/machine/csmInvoiceM/getInvoicePriceByBusiUnit",
    method: "get",
    params: query,
  });
}
